package me2day.api.data
{
	import mx.utils.ObjectProxy;
	
	/**
	* Object that contains information about a Me2day post
	*/
	public dynamic class Me2dayPost extends ObjectProxy
	{
		/**
		* permalink
		*/
		public var permalink:String;
		/**
		* body of post
		*/
		public var body:String;
		/**
		* kind of post
		*/
		public var kind:String;
		/**
		* Post icon URL
		*/
		public var icon:String;
		/**
		* Array of Me2dayTag
		*/
		public var tags:Array;
		/**
		* me2day page URL
		*/
		public var me2dayPage:String;
		/**
		* publish date
		*/
		public var pubDate:String;
		/**
		* comment count
		*/
		public var commentsCount:int;
		/**
		* metoo count
		*/
		public var metooCount:int;
		/**
		* Me2dayAuthor
		*/
		public var author:Me2dayAuthor;
		/**
		* post id
		*/
		public var post_id:String;
		
		public var iconUrl:String;
		public var contentType:String;
		
		public var location_name:String;
		
		public var me2photo:Me2dayPhoto;
		
		public var longitude:Number;
		public var latitude:Number;
		
		function Me2dayPost(post:Object)
		{
			permalink = post.permalink;
			body = post.body;
			kind = post.kind;
			icon = post.icon;
			iconUrl = post.iconUrl;
			contentType = post.contentType;
			if ( contentType == "me2photo" )
				me2photo = new Me2dayPhoto(post.media.me2photo);
			
			tags = [];
			for each (var tempXML:XML in post.tags.children()) 
			{
				var me2dayTag:Me2dayTag = new Me2dayTag(tempXML);
                tags.push(me2dayTag);
            }
			
			me2dayPage = post.me2dayPage;
			pubDate = post.pubDate;
			commentsCount = post.commentsCount;
			metooCount = post.metooCount;
			author = new Me2dayAuthor(post.author);
			post_id = post.post_id;
			
			location_name = post.location.name.toString();
			
			longitude = post.location.longitude;
			latitude = post.location.latitude;
		}
	}
}